/**
 * 此处配置各个柱子的自定义样式，快捷版
 * @param {Object} setting 
 */

function customConfig(setting = {}) {
    let SetSeries = setting.series || {};
    let backgroundStyleTemp = SetSeries.backgroundStyle || {};
    let backgroundStyleDefault = { barBorderRadius: [10, 10, 0, 0], color: !setting.theme ? "rgba(255,255,255,.2)" : "rgba(0,0,0,.1)" };
    let barWidth = SetSeries.barWidth;
    let barBorderRadius = SetSeries.barBorderRadius && Array.isArray(SetSeries.barBorderRadius) && SetSeries.barBorderRadius.length > 0 ? SetSeries.barBorderRadius : [10, 10, 0, 0];
    let showBackground = SetSeries.showBackground || false;
    let backgroundStyle = {
        barBorderRadius: backgroundStyleTemp.barBorderRadius && Array.isArray(backgroundStyleTemp.barBorderRadius) && backgroundStyleTemp.barBorderRadius.length > 0 ? backgroundStyleTemp.barBorderRadius : backgroundStyleDefault.barBorderRadius,
        color: backgroundStyleTemp.color ? backgroundStyleTemp.color : backgroundStyleDefault.color
    };
    let linear = SetSeries.linear || {};
    let stack = SetSeries.stack || {};
    return {
        barWidth,
        barBorderRadius,
        showBackground,
        backgroundStyle,
        linear,
        stack
    }
}
export default customConfig;